<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<title>按时间随机变化的网页背景</title>
<style type="text/css">
<!--
.style2 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 16px;
  text-align: center;
}
.style5 {color: #FFFFFF;font-size: 14px;}
table{
  width: 265px;
  height: 110px;
  margin: 5px auto;
  border-collapse: collapse;
}
td{
  border:1px solid #0000FF;
}
-->
</style>
</head>
<body onLoad="randompic();">
<div class="style2">修改密码</div>
<table>
  <tr>
    <td><span class="style5">用户名：</span></td>
    <td><input name="textfield" type="text"></td>
  </tr>
  <tr>
    <td><span class="style5">密&emsp;码：</span></td>
    <td><input name="textfield2" type="text"></td>
  </tr>
  <tr>
    <td><span class="style5">确认密码：</span></td>
    <td><input name="textfield3" type="text"></td>
  </tr>
  <tr>
    <td colspan="2"><div style="text-align: center">
      <input name="Submit2" type="button" value="保存">
&nbsp;&nbsp;      
<input name="Button" type="button" value="取消">
    </div></td>
  </tr>
</table>
<p>

<script type="text/javascript">
function randompic(){
	var i = Math.floor(Math.random()*5);//取整并*5
	var src = "";
	switch(i){
	 case 0 :
	 	src = "0.jpg";
		break;
	 case 1: 
	 	src = "1.jpg";
	 	break;
	 case 2:
	 	src = "2.jpg";
		break;
	case 3:
		src = "3.jpg";
		break;
	case 4:
		src = "4.jpg";
		break;		
	}
	document.body.background=src;	
	setTimeout("randompic()",1000);
}
</script>
</p>
</body>
</html>
